package com.ruoyi.ring.service.impl;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.ring.domain.RingBloodOxygenDetail;
import com.ruoyi.ring.mapper.RingBloodOxygenDetailMapper;
import com.ruoyi.ring.service.IRingBloodOxygenDetailService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * 血氧详情Service业务层处理
 * 
 * @author liuwp
 * @date 2025-09-03
 */
@Service
public class RingBloodOxygenDetailServiceImpl implements IRingBloodOxygenDetailService 
{
    @Resource
    private RingBloodOxygenDetailMapper ringBloodOxygenDetailMapper;

    /**
     * 查询血氧详情
     * 
     * @param id 血氧详情主键
     * @return 血氧详情
     */
    @Override
    public RingBloodOxygenDetail selectRingBloodOxygenDetailById(Long id)
    {
        return ringBloodOxygenDetailMapper.selectRingBloodOxygenDetailById(id);
    }

    /**
     * 查询血氧详情列表
     * 
     * @param ringBloodOxygenDetail 血氧详情
     * @return 血氧详情
     */
    @Override
    public List<RingBloodOxygenDetail> selectRingBloodOxygenDetailList(RingBloodOxygenDetail ringBloodOxygenDetail)
    {
        return ringBloodOxygenDetailMapper.selectRingBloodOxygenDetailList(ringBloodOxygenDetail);
    }

    /**
     * 根据业务主键查询一条记录：血氧详情
     *
     * @param ringBloodOxygenDetail 血氧详情
     * @return 血氧详情
     */
    @Override
    public RingBloodOxygenDetail selectOneRingBloodOxygenDetail(RingBloodOxygenDetail ringBloodOxygenDetail)
    {
        return ringBloodOxygenDetailMapper.selectOneRingBloodOxygenDetail(ringBloodOxygenDetail);
    }

    /**
     * 新增血氧详情
     * 
     * @param ringBloodOxygenDetail 血氧详情
     * @return 结果
     */
    @Override
    public int insertRingBloodOxygenDetail(RingBloodOxygenDetail ringBloodOxygenDetail)
    {
        ringBloodOxygenDetail.setCreateTime(DateUtils.getNowDate());
        return ringBloodOxygenDetailMapper.insertRingBloodOxygenDetail(ringBloodOxygenDetail);
    }

    /**
     * 修改血氧详情
     * 
     * @param ringBloodOxygenDetail 血氧详情
     * @return 结果
     */
    @Override
    public int updateRingBloodOxygenDetail(RingBloodOxygenDetail ringBloodOxygenDetail)
    {
        ringBloodOxygenDetail.setUpdateTime(DateUtils.getNowDate());
        return ringBloodOxygenDetailMapper.updateRingBloodOxygenDetail(ringBloodOxygenDetail);
    }

    @Override
    public int updateRingBloodOxygenDetailCondition(RingBloodOxygenDetail ringBloodOxygenDetail, RingBloodOxygenDetail ringBloodOxygenDetailCondition)
    {
                ringBloodOxygenDetail.setUpdateTime(DateUtils.getNowDate());
        return ringBloodOxygenDetailMapper.updateRingBloodOxygenDetailCondition(ringBloodOxygenDetail, ringBloodOxygenDetailCondition);
    }

    /**
     * 批量删除血氧详情
     * 
     * @param ids 需要删除的血氧详情主键
     * @return 结果
     */
    @Override
    public int deleteRingBloodOxygenDetailByIds(Long[] ids)
    {
        return ringBloodOxygenDetailMapper.deleteRingBloodOxygenDetailByIds(ids);
    }

    /**
     * 删除血氧详情信息
     * 
     * @param id 血氧详情主键
     * @return 结果
     */
    @Override
    public int deleteRingBloodOxygenDetailById(Long id)
    {
        return ringBloodOxygenDetailMapper.deleteRingBloodOxygenDetailById(id);
    }

    /**
     * 条件删除血氧详情
     *
     * @param ringBloodOxygenDetail 血氧详情
     * @return 结果
     */
    @Override
    public int deleteRingBloodOxygenDetailByCondition(RingBloodOxygenDetail ringBloodOxygenDetail)
    {
        return ringBloodOxygenDetailMapper.deleteRingBloodOxygenDetailByCondition(ringBloodOxygenDetail);
    }

}
